package com.csnf.service.impl;

import csnf.com.entity.*;
import com.csnf.mapper.AdminMapper;
import com.csnf.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminMapper adminMapper;
    @Override
    public int login(Admin admin) {
        int login = adminMapper.login(admin);
        if (login==1){
            return 1;
        }else {
            return 0;
        }
    }
    @Override
    public ArrayList<Merchant> selectAll() {
        ArrayList<Merchant> merchant = adminMapper.selectAll();
        return merchant;
    }
    @Override
    public ArrayList<Merchant> selectMerchantByIsExamine() {
        ArrayList<Merchant> merchant = adminMapper.selectMerchantByIsExamine();
        return merchant;
    }
    @Override
    public ArrayList<Merchant> selectMerchantById(int id) {
        ArrayList<Merchant> merchant = adminMapper.selectMerchantById(id);
        return merchant;
    }
    @Override
    public int updateMerchantIsExamine(Integer id, int isExamine, String remark) {
        return adminMapper.updateMerchantIsExamine(id,isExamine,remark);
    }
}